const OrderObj = require('../modules/Order');
const { log } = require('console');

let OrderController = {
    get_orderFood: async function(req, res){
        let id = req.query.id;
        log(id);
        let resultDate = await OrderObj.getOrderSelect(id);
        res.send(resultDate);
    },
    post_addOrder: async function(req, res){
        let data = req.body;
        let resultDate = await OrderObj.addOrder(data);
        res.send(resultDate);
    },
    post_addOrderFood: async function(req, res){
        let data = req.body;
        let resultDate = await OrderObj.addOrderFood(data);
        res.send(resultDate);
    },
    post_updataOrderFood: async function(req, res){
        let data = req.body;
        let resultDate = await OrderObj.updataOrderFood(data);
        res.send(resultDate);
    },
    post_delOrderFood: async function(req, res){
        let data = req.body;
        let resultDate = await OrderObj.delOrderFood(data);
        res.send(resultDate);
    },
    post_orderInfo: async function(req, res){
        let data = req.body;
        let resultDate = await OrderObj.getOrderInfo(data);
        res.send(resultDate);
    },
    post_setOrder: async function(req, res){
        let data = req.body;
        let resultDate = await OrderObj.setOrder(data);
        res.send(resultDate);
    }
}
module.exports = OrderController;